import Vue from "vue";
import SvgIcon from "@/components/SvgIcon"; // svg component

// register globally
Vue.component("svg-icon", SvgIcon);

const req = require.context("./svg", false, /\.svg$/);
const keys = req.keys();
const requireAll = (requireContext) => keys.map(requireContext);
const result = requireAll(req);

// console.log("*********result*************");
// console.log(result);

let exp = keys.map((i) => {
  let name = i;
  var pos1 = name.lastIndexOf("/");
  var pos2 = name.lastIndexOf("\\");
  var pos = Math.max(pos1, pos2);
  if (pos < 0) {
    name = i;
  }
  return name.substr(pos + 1, name.lastIndexOf(".") - 2);
});
export default exp;
